import { NextApiRequest, NextApiResponse } from "next";
import prisma from "../../../lib/prisma";

export default async function handle(
  req: NextApiRequest,
  res: NextApiResponse
) {
  const { name, email } = req.body;

  const result = await prisma.user.create({
    data: {
      name,
      email,
      password: "123456",
      emailVerified: null,
      createdAt: new Date(),
      updatedAt: new Date(),
    },
  });

  return res.json({
    code: 200,
    data: result,
  });
}
